<admintpl file="header" />
</head>
<body>
<div class="wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a>团队跑客管理</a></li>
        <li><a href="{:U('Bdrunpeople/com_dispatch_add')}">团队跑客添加</a></li>
    </ul>
    <form class="well form-search" method="post" action="{:U('Bdrunpeople/com_dispatch_list')}">
        工号：<input type="text" name="formget[job_number]" style="width: 100px;" value="{$formget.job_number}">
        派单员姓名：<input type="text" name="formget[dispatch_name]" style="width: 100px;" value="{$formget.dispatch_name}" placeholder="请输入关键字...">
        所属团队：
        <select class="select_2" name="formget[company_id]"  style="width: 110px;" >
            <volist name="company_data" id="vo">
                <if condition="$formget.company_id == $vo[company_id]">
                    <option value="{$vo.company_id}" selected>{$vo.company_name}</option>
                    <else /><option value="{$vo.company_id}" >{$vo.company_name}</option>
                </if>
            </volist>
        </select> &nbsp;&nbsp;
        是否接受指派单：
        <select class="select_2" name="formget[is_accept_dispatch]" style="width: 70px;" >
            <option value='-1' {$formget.is_accept_dispatch==-1?selected:''}>全部</option>
            <option value='0' {$formget.is_accept_dispatch==0?selected:''}>否</option>
            <option value='1' {$formget.is_accept_dispatch==1?selected:''}>是</option>
        </select> &nbsp;&nbsp;
        是否签约：
        <select class="select_2" name="formget[is_sign]"  style="width: 70px;" >
            <option value='0' {$formget.is_sign==0?selected:''}>全部</option>
            <option value='1'{$formget.is_sign==1?selected:''}>未签约</option>
            <option value='2' {$formget.is_sign==2?selected:''}>已签约</option>
            <option value='2' {$formget.is_sign==2?selected:''}>已解约</option>
        </select> &nbsp;&nbsp;
        <input type="submit" class="btn btn-primary" value="搜索" />
    </form>
    <form method="post" class="js-ajax-form">
   <!--     <div class="table-actions">
            <button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('Bdrunpeople/sign',array('sign'=>1))}" data-subcheck="true">签约</button>
            <button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('Bdrunpeople/cancelsign',array('unsign'=>1))}" data-subcheck="true">取消签约</button>
            <button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('Bdrunpeople/incubator',array('incubator'=>1))}" data-subcheck="true">领取保温箱</button>
            <button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('Bdrunpeople/freezee',array('freezee'=>1))}" data-subcheck="true" data-msg="您确定冻结账户吗？">冻结</button>
            <button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('Bdrunpeople/cancelfreezee',array('cancelfreezee'=>1))}" data-subcheck="true" data-msg="您确定启用账户吗？">启用</button>
        </div>-->
        <table class="table table-hover table-bordered">
            <thead>
            <tr>
                <th width="15"><label><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label></th>
                <th align="center">序号</th>
                <th>所属团队</th>
                <th>{:L('JOB_NUMBER')}</th>
                <th>{:L('DISPATCH_NAME')}</th>
                <th>{:L('DISPATCH_LEVEL')}</th>
                <th>{:L('WORK_STATUS')}</th>
                <th>{:L('ACCOUNT_STATUS')}</th>
                <th>审核状态</th>
                <th align="center">{:L('ACTIONS')}</th>
            </tr>
            </thead>
            <tbody>
            <php>$account_statuses=array("1"=>'正常',"2"=>'停用',"3"=>'临时冻结');
                $signs=array("0"=>'未签约',"1"=>'未签约',"2"=>'已签约',"3"=>'已解约');</php>
            <foreach name="lists" item="vo" key="k">
                <tr>
                    <td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]" value="{$vo.dispatch_id}" title="ID:{$vo.dispatch_id}"></td>
                    <td align="center">{$k+1}</td>
                    <td>{$vo['company_id']|getCompanyName}</td>
                    <td>{$vo['job_number']}</td>
                    <td>{$vo['dispatch_name']}</td>
                    <td>{$vo['dispatch_level_id']|getPnLevel}</td>
                    <td>{$vo['work_status']==1?听单中:收工}</td>
                    <td>{$account_statuses[$vo['account_status']]}</td>
                    <td>{$vo['dispatch_id']|getPnAudit}<br>{$vo['is_incubator']==0?未领保温箱:已领保温箱}<br>{$signs[$vo['is_sign']] }<br>{$vo['is_accept_dispatch']==0?不接受派单:接受派单}</td>
                    <td align="center">
                        <if condition="is_audit == 0">
                            <a href="{:U('bdrunpeople/com_dispatch_edit',array('dispatch_id'=>empty($vo['dispatch_id'])?'':$vo['dispatch_id'],'formget'=>$formget))}">修改</a> |
                            <a href="{:U('bdrunpeople/com_dispatch_delete',array('dispatch_id'=>empty($vo['dispatch_id'])?'':$vo['dispatch_id'],'formget'=>$formget))}" class="js-ajax-delete">{:L('DELETE')}</a>
                        </if>
                                            <!--    <a href="{:U('bdrunpeople/com_dispatch_see',array('dispatch_id'=>empty($vo['dispatch_id'])?'':$vo['dispatch_id'],'formget'=>$formget))}">{:L('SEE')}</a>-->
                    </td>
                </tr>
            </foreach>
            </tbody>
        </table>
        <if condition="empty($lists)">
            <div style="padding: 30px;text-align: center;color: #999999">
                <i class="fa fa-database" style="font-size: 38px"></i><br />
                暂无数据
            </div>
        </if>
        <div class="pagination">{$page}</div>
    </form>
</div>
<script src="__PUBLIC__/js/common.js"></script>
<script>
    setCookie('refersh_time', 0);
    function refersh_window() {
        var refersh_time = getCookie('refersh_time');
        if (refersh_time == 1) {
            window.location = "{:U('Bdrunpeople/user',$formget)}";
        }
    }
    setInterval(function() {
        refersh_window();
    }, 2000);
    $(function() {
        setCookie("refersh_time", 0);
        Wind.use('ajaxForm', 'artDialog', 'iframeTools', function() {
            //批量移动
            $('.js-articles-move').click(function(e) {
                var str = 0;
                var id = tag = '';
                $("input[name='ids[]']").each(function() {
                    if ($(this).attr('checked')) {
                        str = 1;
                        id += tag + $(this).val();
                        tag = ',';
                    }
                });
                if (str == 0) {
                    art.dialog.through({
                        id : 'error',
                        icon : 'error',
                        content : '您没有勾选信息，无法进行操作！',
                        cancelVal : '关闭',
                        cancel : true
                    });
                    return false;
                }
                var $this = $(this);
            });
        });

    });
</script>
</body>
</html>